import {h} from "../../lib/guide-mini-vue.esm.js";
import {Foo} from './Foo.js'


// 通过 windows.self这个变量来保存render执行时的this,来方便调试
window.self
export const App = {
    render() {
        window.self = this
        // UI
        return h(
            "div",
            {
                id: "root",
                class: ['red', 'hard'],
                // 如何实现事件的注册呢？
                onClick() {
                    console.log("click")
                },
                onMousedown() {
                    console.log("mouse down")
                }
            },
            [h('div', {}, "Hi " + this.msg), h(Foo, {count: 2})]
            // "Hi " + this.msg
            /*  [
                  h(
                      "p",
                      {
                          class: 'red'
                      },
                      "hello "),
                  h(
                      "p",
                      {
                          class: 'blue'
                      },
                      "mini-vue")
              ]*/
        );
    }, setup() {
        return {
            msg: 'mini-vue-haha'
        }
    }
}